package com.sniper.mybatis.service.impl;

import com.sniper.datasource.DataSource;
import com.sniper.datasource.DataSourceValue;
import com.sniper.model.UserRunAs;
import com.sniper.mybatis.service.BaseService;

import java.util.List;

public interface UserRunAsService extends BaseService<UserRunAs> {

    void grantRunAs(String string, String toUserId);

    void revokeRunAs(String fromUserId, String toUserId);

    boolean exists(String fromUserId, String toUserId);

    @DataSource(DataSourceValue.SLAVE)
    List<UserRunAs> findFromUserIds(String fromUserId);

    @DataSource(DataSourceValue.SLAVE)
    List<UserRunAs> findToUserIds(String toUserId);
}
